#!/usr/bin/env node

const fs = require('fs');

const buf = fs.readFileSync('../sm.png');
let data = buf.toString('base64');

//图片
data=`data:image/png;base64,${data}`;

console.log(data);
const http = require('http');

const svr = http.createServer();
svr.on('request',(req,res)=>{
    res.end('<!DOCTYPE html><html><body><img src = "${data}"></body></html>');
});
svr.listen(8080);
